#encoding: utf-8

class ShipperMapsController < ApplicationController
  def index
    bl_no = params[:bl_no]
    conditions = {}
    if bl_no and bl_no.strip != ""
      conditions[:bl_no] = bl_no.strip
    elsif !current_user #如果没有登陆，则认为查询条件为空字符串
      conditions[:bl_no] = ""
    end
    conditions = init_identity_condition(conditions) if conditions.empty?
    @bls = Bl.query_bls(conditions, params[:page])
    flash.now[:notice] = "查询完成"
    respond_to do |format|
      format.html { render :layout => "common" } # index.html.erb
      format.json { render :json => {:notice => flash.now[:notice], :html => render_to_string(:template => '/utils/_bl_and_ctns.html.erb')} }
    end
  end

  before_filter :clean_page, :only => [:index]
  skip_before_filter :require_login
end
